.md_preview {
  overflow: hidden;
  * {
    box-sizing: border-box;
  }
  // 字体使用云效样式
  // font-family: system-ui, -apple-system, BlinkMacSystemFont, segoe ui, Roboto, Helvetica, Arial, sans-serif,
  //   apple color emoji, segoe ui emoji, segoe ui symbol;

  // 标题
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: #292929;
    margin: 8px 0 16px;
    font-weight: 600;
  }
  h1 {
    font-size: 22px;
    line-height: 30px;
  }
  h2 {
    font-size: 20px;
    line-height: 28px;
  }
  h3 {
    font-size: 18px;
    line-height: 26px;
  }
  h4 {
    font-size: 16px;
    line-height: 24px;
  }
  h5 {
    font-size: 16px;
    line-height: 24px;
  }
  h6 {
    font-size: 16px;
    line-height: 24px;
  }

  // 段落
  p:not(:last-child) {
    font-size: 16px;
    color: var(--md-editor-text-color-active);
    font-weight: 400;
    line-height: 26px !important;
    margin: 0 0 16px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  p[align='center'] {
    text-align: center;
  }

  // 列表
  ol,
  ul {
    margin: 0 0 24px;
    padding: 0;
    font-size: 16px;
  }
  ul {
    ol {
      margin: 0 0 24px 32px;
    }
    li {
      list-style-type: '-';
      margin: 8px 0 0 8px;
      padding-left: 6px;
    }
  }
  ol {
    li {
      list-style-type: decimal;
      margin-left: 40px;
      margin-top: 8px;
    }
  }

  // 链接
  a {
    color: #1c40d2 !important;
    text-decoration: none;
    & > img {
      padding: 1px;
      margin: 1px;
      border: none;
      outline: #0782c1 solid 1px;
    }
    // &:visited {
    //   color: #6795b5;
    // }
    // &:focus,&:hover{
    //   color: #ca0c16;
    // }
  }

  // 图片
  img {
    max-width: 100%;
    display: block;
    // height: auto;
    &.right {
      border: 1px solid #ccc;
      float: right;
      margin-left: 15px;
      padding: 5px;
    }
    &.left {
      border: 1px solid #ccc;
      float: left;
      margin-right: 15px;
      padding: 5px;
    }
    &.mathcode {
      margin: 0 8px;
    }
  }
  .image-grayscale img,
  img.image-grayscale {
    filter: grayscale(100%);
  }

  // 引用
  blockquote {
    display: block;
    padding: 16px 16px 0;
    margin: 0 0 24px;
    border-left: 8px solid #dddfe4;
    background: #eef0f4;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    word-wrap: normal;
    word-break: normal;
    p {
      font-size: 16px;
      line-height: 26px;
      font-weight: 400;
      margin-bottom: 16px;
      color: #4f4f4f;
    }
    ol,
    ul {
      margin-bottom: 16px;
      padding: 0;
      font-size: 16px;
      line-height: 24px;
    }
    ol li,
    ul li {
      margin-bottom: 0;
    }
  }

  // 代码
  pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0 0 24px;
    overflow: hidden;
    code {
      display: block;
      line-height: 22px;
      overflow-x: auto;
      overflow-y: hidden;
      white-space: pre;
      word-wrap: normal;
      border-radius: 4px;
      padding: 8px;
      tab-size: 4;
      code {
        &.md_hljs {
          padding: 0;
        }
      }
      &:not(.md_hljs) {
        background-color: var(--md-editor-code-bg-color, #f3f4f5);
      }
    }
  }
  code {
    border-radius: 4px;
    display: inline-block;
    background-color: var(--md-editor-code-bg-color, #f3f4f5);
    padding: 2px 6px;
    ol {
      margin: 0;
      overflow: hidden;
      li {
        list-style-type: none;
        margin-left: 0;
        margin-top: 0;
        height: 22px;
        div {
          &.hljs-ln-code {
            margin-left: 8px;
          }
          &.hljs-ln-numbers {
            width: 24px;
            border-right: 1px solid #c5c5c5;
            .hljs-ln-line {
              word-wrap: normal;
            }
          }
        }
      }
      &.hundred {
        li {
          div {
            &.hljs-ln-numbers {
              width: 30px;
            }
          }
        }
      }
      &.thousand {
        li {
          div {
            &.hljs-ln-numbers {
              width: 36px;
            }
          }
        }
      }
    }
  }

  // 表格
  table {
    border-collapse: collapse;
    display: table;
    width: 100%;
    text-align: left;
    margin-bottom: 24px;
    margin-left: auto;
    margin-right: auto;
    tr {
      border: 0;
      border-top: 1px solid #ddd;
      background-color: #fff;
      &:nth-child(2n) {
        background-color: #f7f7f7;
      }
      td,
      th {
        border: 1px solid #ddd;
        font-size: 14px;
        color: #4f4f4f;
        line-height: 22px;
        padding: 8px;
        text-align: left;
        p {
          font-size: 14px;
          color: #4f4f4f;
          margin: 0;
          padding: 0;
          text-align: left;
          line-height: 22px;
        }
        code {
          white-space: normal;
          word-break: break-word;
        }
      }
      th {
        font-weight: 700;
        background-color: #eff3f5;
        p {
          font-weight: 700;
        }
      }
    }
  }
  tbody {
    border: 0;
  }
  dl {
    margin: 24px;
    dt {
      margin: 8px;
      font-weight: 700;
      dd {
        margin: 8px;
      }
    }
    dd {
      margin: 0 0 8px 40px;
    }
  }

  // 分隔
  hr {
    margin: 24px 0;
    border: none;
    border-bottom: solid #ccc 1px;
  }
  address,
  cite,
  dfn,
  em,
  i,
  span[lang],
  em strong,
  var {
    font-style: italic;
  }

  // 加粗
  strong,
  strong span,
  strong em {
    font-weight: 600;
  }

  abbr[data-original-title],
  abbr[title] {
    cursor: help;
    border-bottom: 1px dotted #999;
  }

  .marker {
    background-color: #ff0;
  }
  figure {
    text-align: center;
    margin: 0 24px;
    display: inline-block;
    & > figcaption {
      text-align: center;
      margin: 8px;
      color: #999;
      font-size: 14px;
      display: block;
    }
  }

  .code-featured {
    border: 5px solid red;
  }
  .math-featured {
    padding: 20px;
    box-shadow: 0 0 2px rgba(200, 0, 0, 1);
    background-color: rgba(255, 0, 0, 0.05);
    margin: 10px;
  }
  .image-clean {
    border: 0;
    background: 0 0;
    padding: 0;
    & > figcaption {
      font-size: 0.9em;
      text-align: right;
    }
  }
  .image-grayscale {
    background-color: #fff;
    color: #666;
  }

  .initialism {
    font-size: 90%;
    text-transform: uppercase;
  }

  .hot-keyword {
    &:visited {
      color: #3399ea;
    }
  }
  .footnote {
    vertical-align: top;
    position: relative;
    top: -4px;
    font-size: 12px;
  }
  .MathJax_SVG_Display {
    text-align: center;
    margin: 24px 0;
    font-size: 18px;
    font-weight: 400;
    color: #4f4f4f;
    position: relative;
    text-indent: 0;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    width: 100%;
  }
  .prettyprint {
    .pre-numbering {
      position: absolute;
      width: 48px;
      background-color: #eef0f4;
      top: 0;
      left: 0;
      margin: 0;
      padding: 8px 0;
      list-style: none;
      text-align: right;
    }
  }
  .pre-numbering {
    li {
      padding: 0 8px;
      list-style: none;
      margin: 0;
    }
  }
  kbd {
    padding: 2px 8px;
    border: 1px solid rgba(63, 63, 63, 0.25);
    box-shadow: 0 1px 0 rgba(63, 63, 63, 0.25);
    background-color: #fff;
    color: #333;
    border-radius: 4px;
    display: inline-block;
    margin: 0 2px;
    white-space: nowrap;
  }
  .dp-highlighter {
    font-size: 12px;
    text-align: left;
    margin: 0 0 24px;
  }
  pre[data-from='code-for-outside'] {
    overflow: hidden;
    code {
      overflow-x: auto;
      overflow-y: hidden;
      * {
        overflow: visible;
        overflow-wrap: break-word;
      }
    }
    p {
      code {
        padding: 0;
      }
    }
  }
  .cke_editable {
    margin: 24px;
    word-wrap: break-word;
  }
}

.md_preview kbd,
.md_preview pre,
.md_preview samp {
  font-family: Consolas, Inconsolata, Courier, monospace;
  font-size: 14px;
  line-height: 22px;
  // color: #000;
}

.md_preview code ol li div.hljs-ln-code,
.md_preview code ol li div.hljs-ln-numbers,
.md_preview pre code,
.md_preview pre code div,
.md_preview pre code span {
  font-family: 'Source Code Pro', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Anonymous Pro', 'Droid Sans Mono', Menlo, Monaco,
    Consolas, Inconsolata, Courier, monospace, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.md_preview pre code,
.md_preview pre code div,
.md_preview pre code span {
  font-size: 14px;
}
.md_preview .prettyprint,
.md_preview pre.prettyprint {
  margin: 0 0 24px;
  padding: 8px 16px 4px 56px;
  background-color: #f6f8fa;
  border: none;
}
.md_preview code ol li div.hljs-ln-code,
.md_preview code ol li div.hljs-ln-numbers {
  float: left;
  height: 22px;
}

.md_preview pre code .hljs-comment {
  color: green;
}
